package cc.wsyw126.java.lambda.java8lambda.exercise;

import cc.wsyw126.java.lambda.java8lambda.base.Artist;
import cc.wsyw126.java.lambda.java8lambda.data.SampleData;
import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;

public class SteamOpTest {

	@Test
	public void TestGetNamesOfArtists_Lambda() {
		List<Artist> artists = SampleData.getThreeArtists();
		List<String> res = SteamOp.getNamesOfArtists_Lambda(artists);
		Assert.assertEquals(Arrays.asList("John Coltrane", "John Lennon", "The Beatles"), res);
	}

	@Test
	public void TestArtistsLivingInUK() {
		List<Artist> artists = SampleData.getThreeArtists();
		List<Artist> res = SteamOp.artistsLivingInUK(artists);
		Assert.assertFalse(res.isEmpty());
	}
}
